<div id="js-bulk-actions-wrapper" class="relative">
  <button
    id="js-bulk-actions-button"
    class="button button__sm button__transparent-secondary"
    type="button"
    data-controller="dropdown"
    data-target="js-bulk-actions-dropdown">
    <%= t("decidim.proposals.admin.proposals.index.actions") %>
    <%= icon "arrow-down-s-line" %>
    <%= icon "arrow-down-s-line" %>
  </button>

  <ul
    id="js-bulk-actions-dropdown"
    class="dropdown dropdown__bottom"
    aria-hidden="true">
    <% if current_component_taxonomy_filters&.any? %>
      <li class="dropdown__item">
        <button type="button" class="dropdown__button" data-action="taxonomy-change-proposals">
          <%= t("decidim.proposals.admin.proposals.index.change_taxonomies") %>
        </button>
      </li>
    <% end %>
    <li class="dropdown__item">
      <button type="button" class="dropdown__button" data-action="merge-proposals" data-merge-dialog="merge-proposals_drawer" data-merge-url="<%= new_proposals_merge_path %>">
        <%= t("decidim.proposals.admin.proposals.index.merge") %>
      </button>
    </li>
    <li class="dropdown__item">
      <button type="button" class="dropdown__button" data-action="split-proposals">
        <%= t("decidim.proposals.admin.proposals.index.split") %>
      </button>
    </li>
    <li class="dropdown__item">
      <button type="button" class="dropdown__button" data-action="assign-proposals-to-evaluator">
        <%= t("decidim.proposals.admin.proposals.index.assign_to_evaluator") %>
      </button>
    </li>
    <% if allowed_to? :unassign_from_evaluator, :proposals, evaluator: current_user %>
      <li class="dropdown__item">
        <button type="button" class="dropdown__button" data-action="unassign-proposals-from-evaluator">
          <%= t("decidim.proposals.admin.proposals.index.unassign_from_evaluator") %>
        </button>
      </li>
    <% end %>
    <% if templates_available? %>
      <li class="dropdown__item">
        <button type="button" class="dropdown__button" data-action="apply-answer-template">
          <%= t("decidim.proposals.admin.proposals.index.apply_answer_template") %>
        </button>
      </li>
    <% end %>
    <li class="dropdown__item">
      <button type="button" class="dropdown__button" data-action="publish-answers">
        <%= t("decidim.proposals.admin.proposals.index.publish_answers") %>
      </button>
    </li>
  </ul>
</div>
